package top.yueyazhui.ask_for_leave.util;

import org.springframework.security.core.context.SecurityContextHolder;
import top.yueyazhui.ask_for_leave.entity.User;

/**
 * @Author yueyazhui
 * @Date 2023/2/11
 */
public class UserUtil {

    public static User getCurrentUser() {
        return ((User) SecurityContextHolder.getContext().getAuthentication().getPrincipal());
    }
}
